{% extends "shop/base.html" %}
{% load static %}

 {% block ext_css %}
<link rel="stylesheet" href="{% static 'dist/css/common.css'%}">
 {% endblock %}

 {% block content%}
<div class="content-wrapper">
    <div class="content-header">
        <div class="container-fluid">
            <div>
                <div class="row">
                    <div class="col-sm-6">
                        <h1 class="m-0">
                            会员模块                    <small>列表</small>
                        </h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-right">
                            <li class="breadcrumb-item"><a href="/admin/index/index.html">Home</a></li>
                            <li class="breadcrumb-item active"><a href="/admin/Article/index.html">会员模块</a></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--内容开始-->
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12 search-collapse">
                    <form id="search_form">
                        <div class="select-list">
                            <ul>
                                <li>
                                    <label>分类： </label>
                                    <select id="search_cate_id" name="cate_id">
                                        <option value="">所有</option>
                                        <option value="1">钻石卡会员</option>
                                        <option value="2">金卡会员</option>
                                        <option value="3">银卡会员</option>
                                        <option value="4">寂寞卡会员</option>
                                    </select>
                                </li>
                                <li>
                                    <label>名称： </label>

                                    <input type="text" id="search_title" name="title" value="" />
                                </li>
                                <li>
                                    <label>状态： </label>
                                    <select id="search_status" name="status">
                                        <option value="">所有</option>
                                        <option value="0">正常</option>
                                        <option value="1">异常</option>
                                    </select>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                    <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fas fa-sync-alt"></i>&nbsp;重置</a>
                                    <input class="hide" type="submit" name="btnSave" value="提交" onclick="$.table.search();return false;" />
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>

                <div class="col-sm-12 select-table table-striped">
                    <div class="btn-group-sm" id="toolbar" role="group">
                        <a class="btn btn-success" onclick="$.operate.add()">
                            <i class="fa fa-plus"></i> 新增
                        </a>
                        <a class="btn btn-primary single disabled" onclick="$.operate.edit()">
                            <i class="fa fa-edit"></i> 修改
                        </a>
                        <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
                            <i class="fa fa-times"></i> 删除
                        </a>
                        <a class="btn btn-warning" onclick="$.table.export()">
                            <i class="fa fa-download"></i> 导出
                        </a>
                    </div>
                    <table id="bootstrap-table" data-mobile-responsive="true"></table>
                </div>
            </div>
        </div>
    </section>

    <div class="col-sm-12 main">
        <br>
        <div class="panel panel-primary">
            <div class="panel-body">
                <table class="table table-bordered table-condensed table-striped table-hover">
                    <thead>
                        <tr>
                            <th>账号</th>
                            <th>真实姓名</th>
                            <th>性别</th>
                            <th>生日</th>
                            <th>email</th>
                            <th>手机</th>
                            <th>添加时间</th>
                            <th>用户头像</th>
                            <th>功能操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for per in members %}
                        <tr>
                            <td>{{ per.username }}</td>
                            <td>{{ per.truename }}</td>
                            <td>{{ per.sex }}</td>
                            <td>{{ per.birthday }}</td>
                            <td>{{ per.email }}</td>
                            <td>{{ per.mobile }}</td>
                            <td>{{ per.add_time }}</td>
                            <td width="5%"><img src="/media/{{ per.logo }}" width="100px" height="100px" /></td>
                            <td width="20%">
                                <a class="btn btn-primary single disabled" onclick="$.operate.edit()">
                                    <i class="fa fa-edit"></i> 修改
                                </a>
                                <a class="btn btn-danger multiple disabled" onclick="delcfm('${ctxPath}/manager/project/delete?id=${vo.id?default("")}')">
                                    <i class="fa fa-times"></i> 删除
                                </a>
                                <a class="btn btn-warning" onclick="$.table.export()">
                                    <i class="fa fa-download"></i> 导出
                                </a>
                            </td>
                        </tr>
                        {% empty %}
                        <tr>
                            <td colspan="7">无相关记录！</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <nav aria-label="Contacts Page Navigation">
        <ul class="pagination justify-content-center m-2">
            {% if members.has_previous %}
            <li class="page-item">
                <a class="page-link" href="?page={{ members.previous_page_number }}">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            {% endif %}

            {% for pg in members.paginator.page_range %}
            {% if members.number == pg %}
            <li class="page-item active">
                <a class="page-link" href="?page={{pg}}">{{ pg }}</a>
            </li>
            {% else %}
            <li class="page-item">
                <a class="page-link" href="?page={{pg}}">{{ pg }}</a>
            </li>
            {% endif %}
            {% endfor %}

            {% if members.has_next %}
            <li class="page-item">
                <a class="page-link" href="?page={{ members.next_page_number }}">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
            {% endif %}
        </ul>
    </nav>
</div>

<!-- 信息删除确认模态框 -->
<div class="modal fade" id="delcfmModel">
    <div class="modal-dialog">
        <div class="modal-content message_align">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title">提示信息</h4>
            </div>
            <div class="modal-body">
                <p>您确认要删除吗？</p>
            </div>
            <div class="modal-footer">
                <input type="hidden" id="url" />
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <a onclick="urlSubmit()" class="btn btn-success"
                   data-dismiss="modal">确定</a>
            </div>
        </div>
    </div>
</div>
{% endblock %}